<script setup lang="ts">
import { useTestStore } from "@/stores/test";

const count = ref(0);
const router = useRouter();
const Counter = useTestStore();
const loginOut = () => {
  Counter.zero();
  localStorage.setItem("app-token", "");
  router.push("/login");
};
</script>

<template>
  <div>
    me count: {{ count }} | 状态: {{ Counter.count }}
    <button
      type="button"
      @click="
        Counter.inc();
        count++;
      "
    >
      计数
    </button>
  </div>
  <p>{{ $t("about") }}&nbsp;<button @click="loginOut">退出</button></p>
</template>

<style scoped lang="scss"></style>

<route>
{
  meta: {
    requiresAuth: true
  }
}
</route>
